aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-05 12:32:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-05 12:32:56 +0000
commit32a457a2f1f7927fccc6e7c663646b2e54dacfda (patch)
tree0bfe15f21bc1f0d8a37401cba6b0be398f67e66c
parent791b90eb11433ffe03c1b7c72b270413e38025a0 (diff)
downloadpaludis-32a457a2f1f7927fccc6e7c663646b2e54dacfda.tar.gz
paludis-32a457a2f1f7927fccc6e7c663646b2e54dacfda.tar.xz
More inquisitio
-rw-r--r--src/clients/inquisitio/Makefile.am13
-rw-r--r--src/clients/inquisitio/do_search.cc6
-rw-r--r--src/clients/inquisitio/matcher.cc2
-rw-r--r--src/clients/inquisitio/matcher.hh5
-rw-r--r--src/clients/inquisitio/matcher.sr11
-rw-r--r--src/clients/inquisitio/pcre_matcher.cc4
-rw-r--r--src/clients/inquisitio/pcre_matcher.hh2
-rw-r--r--src/clients/inquisitio/text_matcher.cc5
-rw-r--r--src/clients/inquisitio/text_matcher.hh2
9 files changed, 12 insertions, 38 deletions
diff --git a/src/clients/inquisitio/Makefile.am b/src/clients/inquisitio/Makefile.am
index 4a90b06..a14592f 100644
--- a/src/clients/inquisitio/Makefile.am
+++ b/src/clients/inquisitio/Makefile.am
@@ -70,21 +70,12 @@ TESTS = version_TEST help_TEST
EXTRA_DIST = \
$(man_MANS) \
- $(TESTS) \
- matcher-sr.hh matcher-sr.cc matcher.sr
+ $(TESTS)
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
-DISTCLEANFILES = $(man_MANS) $(noinst_DATA) matcher-sr.hh matcher-sr.cc
+DISTCLEANFILES = $(man_MANS) $(noinst_DATA)
MAINTAINERCLEANFILES = Makefile.in
-BUILT_SOURCES = matcher-sr.hh matcher-sr.cc
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-matcher-sr.hh : matcher.sr $(top_srcdir)/misc/make_sr.bash
- if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/matcher.sr > $@ ; then rm -f $@ ; exit 1 ; fi
-
-matcher-sr.cc : matcher.sr $(top_srcdir)/misc/make_sr.bash
- if ! $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/matcher.sr > $@ ; then rm -f $@ ; exit 1 ; fi
-
-
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index 184063d..85f8025 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -47,9 +47,7 @@ do_search(const Environment & env)
extractors.push_back(ExtractorMaker::get_instance()->find_maker(*p)(env));
if (extractors.empty())
- extractors.push_back(ExtractorMaker::get_instance()->find_maker("text")(env));
-
- MatcherOptions opts(false);
+ extractors.push_back(ExtractorMaker::get_instance()->find_maker("name")(env));
std::set<QualifiedPackageName> pkgs;
@@ -113,7 +111,7 @@ do_search(const Environment & env)
std::string xx((**x)(display_entry));
for (std::list<std::tr1::shared_ptr<Matcher> >::const_iterator m(matchers.begin()),
m_end(matchers.end()) ; m != m_end && ! match ; ++m)
- if ((**m)(xx, opts))
+ if ((**m)(xx))
match = true;
}
diff --git a/src/clients/inquisitio/matcher.cc b/src/clients/inquisitio/matcher.cc
index 16a0375..c060822 100644
--- a/src/clients/inquisitio/matcher.cc
+++ b/src/clients/inquisitio/matcher.cc
@@ -24,8 +24,6 @@
using namespace inquisitio;
using namespace paludis;
-#include <src/clients/inquisitio/matcher-sr.cc>
-
Matcher::Matcher()
{
}
diff --git a/src/clients/inquisitio/matcher.hh b/src/clients/inquisitio/matcher.hh
index d518e50..765244f 100644
--- a/src/clients/inquisitio/matcher.hh
+++ b/src/clients/inquisitio/matcher.hh
@@ -27,9 +27,6 @@
namespace inquisitio
{
-
-#include <src/clients/inquisitio/matcher-sr.hh>
-
class Matcher :
private paludis::InstantiationPolicy<Matcher, paludis::instantiation_method::NonCopyableTag>
{
@@ -39,7 +36,7 @@ namespace inquisitio
public:
virtual ~Matcher();
- virtual bool operator() (const std::string &, const MatcherOptions &) const = 0;
+ virtual bool operator() (const std::string &) const = 0;
};
class NoSuchMatcherError :
diff --git a/src/clients/inquisitio/matcher.sr b/src/clients/inquisitio/matcher.sr
deleted file mode 100644
index 8b0dee8..0000000
--- a/src/clients/inquisitio/matcher.sr
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_MatcherOptions()
-{
- key full_match bool
-
- allow_named_args
-}
-
-
diff --git a/src/clients/inquisitio/pcre_matcher.cc b/src/clients/inquisitio/pcre_matcher.cc
index 45b3577..015c8b1 100644
--- a/src/clients/inquisitio/pcre_matcher.cc
+++ b/src/clients/inquisitio/pcre_matcher.cc
@@ -31,7 +31,7 @@ namespace paludis
mutable pcrepp::Pcre::Pcre pattern;
Implementation(const std::string & s) :
- pattern(s)
+ pattern(s, "i")
{
}
};
@@ -43,7 +43,7 @@ PCREMatcher::PCREMatcher(const std::string & s) :
}
bool
-PCREMatcher::operator() (const std::string & s, const MatcherOptions &) const
+PCREMatcher::operator() (const std::string & s) const
{
return _imp->pattern.search(s);
}
diff --git a/src/clients/inquisitio/pcre_matcher.hh b/src/clients/inquisitio/pcre_matcher.hh
index a67cfce..8d5fdcb 100644
--- a/src/clients/inquisitio/pcre_matcher.hh
+++ b/src/clients/inquisitio/pcre_matcher.hh
@@ -33,7 +33,7 @@ namespace inquisitio
PCREMatcher(const std::string &);
virtual ~PCREMatcher();
- bool operator() (const std::string &, const MatcherOptions &) const;
+ bool operator() (const std::string &) const;
};
}
diff --git a/src/clients/inquisitio/text_matcher.cc b/src/clients/inquisitio/text_matcher.cc
index c913b58..dd096fc 100644
--- a/src/clients/inquisitio/text_matcher.cc
+++ b/src/clients/inquisitio/text_matcher.cc
@@ -18,6 +18,7 @@
*/
#include "text_matcher.hh"
+#include <string.h>
using namespace paludis;
using namespace inquisitio;
@@ -42,9 +43,9 @@ TextMatcher::TextMatcher(const std::string & s) :
}
bool
-TextMatcher::operator() (const std::string & s, const MatcherOptions &) const
+TextMatcher::operator() (const std::string & s) const
{
- return std::string::npos != s.find(_imp->pattern);
+ return 0 != strcasestr(s.c_str(), _imp->pattern.c_str());
}
TextMatcher::~TextMatcher()
diff --git a/src/clients/inquisitio/text_matcher.hh b/src/clients/inquisitio/text_matcher.hh
index a317c89..8dc4703 100644
--- a/src/clients/inquisitio/text_matcher.hh
+++ b/src/clients/inquisitio/text_matcher.hh
@@ -33,7 +33,7 @@ namespace inquisitio
TextMatcher(const std::string &);
virtual ~TextMatcher();
- bool operator() (const std::string &, const MatcherOptions &) const;
+ bool operator() (const std::string &) const;
};
}