|
a/src/rcldb/searchdata.h |
|
b/src/rcldb/searchdata.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _SEARCHDATA_H_INCLUDED_
|
17 |
#ifndef _SEARCHDATA_H_INCLUDED_
|
18 |
#define _SEARCHDATA_H_INCLUDED_
|
18 |
#define _SEARCHDATA_H_INCLUDED_
|
19 |
/* @(#$Id: searchdata.h,v 1.9 2007-01-25 15:50:54 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: searchdata.h,v 1.10 2007-02-13 10:58:32 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
/**
|
21 |
/**
|
22 |
* Structures to hold data coming almost directly from the gui
|
22 |
* Structures to hold data coming almost directly from the gui
|
23 |
* search fields and handle its translation to Xapian queries.
|
23 |
* search fields and handle its translation to Xapian queries.
|
24 |
* This is not generic code, it reflects the choices made for the user
|
24 |
* This is not generic code, it reflects the choices made for the user
|
|
... |
|
... |
119 |
SearchData& operator=(const SearchData&) {return *this;};
|
119 |
SearchData& operator=(const SearchData&) {return *this;};
|
120 |
};
|
120 |
};
|
121 |
|
121 |
|
122 |
class SearchDataClause {
|
122 |
class SearchDataClause {
|
123 |
public:
|
123 |
public:
|
124 |
SearchDataClause(SClType tp) : m_tp(tp), m_parentSearch(0) {}
|
124 |
SearchDataClause(SClType tp)
|
|
|
125 |
: m_tp(tp), m_parentSearch(0), m_modifiers(SDCM_NONE)
|
|
|
126 |
{}
|
|
|
127 |
|
125 |
virtual ~SearchDataClause() {}
|
128 |
virtual ~SearchDataClause() {}
|
126 |
|
129 |
|
127 |
virtual bool toNativeQuery(Rcl::Db &db, void *, const string&) = 0;
|
130 |
virtual bool toNativeQuery(Rcl::Db &db, void *, const string&) = 0;
|
128 |
|
131 |
|
129 |
virtual bool isFileName() const {return m_tp==SCLT_FILENAME ? true: false;}
|
132 |
bool isFileName() const {return m_tp==SCLT_FILENAME ? true: false;}
|
130 |
|
133 |
|
131 |
virtual string getReason() const {return m_reason;}
|
134 |
virtual string getReason() const {return m_reason;}
|
132 |
|
135 |
|
133 |
virtual bool getTerms(vector<string>&, vector<vector<string> >&,
|
136 |
virtual bool getTerms(vector<string>&, vector<vector<string> >&,
|
134 |
vector<int>&) const
|
137 |
vector<int>&) const
|
135 |
{return true;}
|
138 |
{return true;}
|
|
|
139 |
|
136 |
virtual SClType getTp() {return m_tp;}
|
140 |
SClType getTp() {return m_tp;}
|
137 |
|
141 |
|
138 |
virtual void setParent(SearchData *p) {m_parentSearch = p;}
|
142 |
void setParent(SearchData *p) {m_parentSearch = p;}
|
|
|
143 |
|
139 |
friend class SearchData;
|
144 |
friend class SearchData;
|
|
|
145 |
|
|
|
146 |
enum Modifier {SDCM_NONE=0, SDCM_NOSTEMMING=1};
|
|
|
147 |
virtual void setModifiers(Modifier mod) {m_modifiers = mod;}
|
140 |
|
148 |
|
141 |
protected:
|
149 |
protected:
|
142 |
string m_reason;
|
150 |
string m_reason;
|
143 |
SClType m_tp;
|
151 |
SClType m_tp;
|
144 |
SearchData *m_parentSearch;
|
152 |
SearchData *m_parentSearch;
|
145 |
bool m_haveWildCards;
|
153 |
bool m_haveWildCards;
|
|
|
154 |
Modifier m_modifiers;
|
146 |
};
|
155 |
};
|
147 |
|
156 |
|
148 |
/**
|
157 |
/**
|
149 |
* "Simple" data clause with user-entered query text. This can include
|
158 |
* "Simple" data clause with user-entered query text. This can include
|
150 |
* multiple phrases and words, but no specified distance.
|
159 |
* multiple phrases and words, but no specified distance.
|