summaryrefslogtreecommitdiffstats
path: root/3rdparty/clucene/src/CLucene/search/WildcardQuery.h
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit50123887ba0f33cf47520bee7c419d68742af2d1 (patch)
tree0eb8679b9e4e4370e59b44bfdcae616816e39aca /3rdparty/clucene/src/CLucene/search/WildcardQuery.h
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to '3rdparty/clucene/src/CLucene/search/WildcardQuery.h')
-rw-r--r--3rdparty/clucene/src/CLucene/search/WildcardQuery.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/3rdparty/clucene/src/CLucene/search/WildcardQuery.h b/3rdparty/clucene/src/CLucene/search/WildcardQuery.h
new file mode 100644
index 000000000..cfc38f648
--- /dev/null
+++ b/3rdparty/clucene/src/CLucene/search/WildcardQuery.h
@@ -0,0 +1,69 @@
+/*------------------------------------------------------------------------------
+* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
+*
+* Distributable under the terms of either the Apache License (Version 2.0) or
+* the GNU Lesser General Public License, as specified in the COPYING file.
+------------------------------------------------------------------------------*/
+#ifndef _lucene_search_WildcardQuery_
+#define _lucene_search_WildcardQuery_
+#if defined(_LUCENE_PRAGMA_ONCE)
+# pragma once
+#endif
+
+#include "CLucene/index/IndexReader.h"
+#include "CLucene/index/Term.h"
+#include "MultiTermQuery.h"
+#include "WildcardTermEnum.h"
+
+CL_NS_DEF(search)
+
+ /** Implements the wildcard search query. Supported wildcards are <code>*</code>, which
+ * matches any character sequence (including the empty one), and <code>?</code>,
+ * which matches any single character. Note this query can be slow, as it
+ * needs to iterate over all terms. In order to prevent extremely slow WildcardQueries,
+ * a Wildcard term must not start with one of the wildcards <code>*</code> or
+ * <code>?</code>.
+ *
+ * @see WildcardTermEnum
+ */
+ class WildcardQuery: public MultiTermQuery {
+ protected:
+ FilteredTermEnum* getEnum(CL_NS(index)::IndexReader* reader);
+ WildcardQuery(const WildcardQuery& clone);
+ public:
+ WildcardQuery(CL_NS(index)::Term* term);
+ ~WildcardQuery();
+
+ //Returns the string "WildcardQuery"
+ const TCHAR* getQueryName() const;
+ static const TCHAR* getClassName();
+
+ size_t hashCode() const;
+ bool equals(Query* other) const;
+ Query* clone() const;
+ };
+
+
+
+class WildcardFilter: public Filter
+{
+private:
+ CL_NS(index)::Term* term;
+protected:
+ WildcardFilter( const WildcardFilter& copy );
+
+public:
+ WildcardFilter(CL_NS(index)::Term* term);
+ ~WildcardFilter();
+
+ /** Returns a BitSet with true for documents which should be permitted in
+ search results, and false for those that should not. */
+ CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader );
+
+ Filter* clone() const;
+ TCHAR* toString();
+};
+
+
+CL_NS_END
+#endif