|
a/src/query/wasastringtoquery.h |
|
b/src/query/wasastringtoquery.h |
1 |
#ifndef _WASASTRINGTOQUERY_H_INCLUDED_
|
1 |
#ifndef _WASASTRINGTOQUERY_H_INCLUDED_
|
2 |
#define _WASASTRINGTOQUERY_H_INCLUDED_
|
2 |
#define _WASASTRINGTOQUERY_H_INCLUDED_
|
3 |
/* @(#$Id: wasastringtoquery.h,v 1.5 2007-02-12 18:16:08 dockes Exp $ (C) 2006 J.F.Dockes */
|
3 |
/* @(#$Id: wasastringtoquery.h,v 1.6 2008-01-17 11:14:13 dockes Exp $ (C) 2006 J.F.Dockes */
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
8 |
* (at your option) any later version.
|
8 |
* (at your option) any later version.
|
|
... |
|
... |
34 |
* negated (AND NOT).
|
34 |
* negated (AND NOT).
|
35 |
*
|
35 |
*
|
36 |
* For LEAF elements, the value can hold one or several words. In the
|
36 |
* For LEAF elements, the value can hold one or several words. In the
|
37 |
* latter case, it should be interpreted as a phrase (comes from a
|
37 |
* latter case, it should be interpreted as a phrase (comes from a
|
38 |
* user-entered "quoted string").
|
38 |
* user-entered "quoted string").
|
|
|
39 |
*
|
|
|
40 |
* Some fields only make sense either for compound or LEAF queries. This
|
|
|
41 |
* is commented for each. We should subclass really.
|
39 |
*/
|
42 |
*/
|
40 |
class WasaQuery {
|
43 |
class WasaQuery {
|
41 |
public:
|
44 |
public:
|
42 |
enum Op {OP_NULL, OP_LEAF, OP_EXCL, OP_OR, OP_AND};
|
45 |
enum Op {OP_NULL, OP_LEAF, OP_EXCL, OP_OR, OP_AND};
|
43 |
typedef vector<WasaQuery*> subqlist_t;
|
46 |
typedef vector<WasaQuery*> subqlist_t;
|
|
... |
|
... |
52 |
void describe(string &desc) const;
|
55 |
void describe(string &desc) const;
|
53 |
|
56 |
|
54 |
/** Op to be performed on either value (may be LEAF or EXCL, or subqs */
|
57 |
/** Op to be performed on either value (may be LEAF or EXCL, or subqs */
|
55 |
WasaQuery::Op m_op;
|
58 |
WasaQuery::Op m_op;
|
56 |
|
59 |
|
57 |
/** Field specification if any (ie: title, author ...) */
|
60 |
/** Field specification if any (ie: title, author ...) Only OPT_LEAF */
|
58 |
string m_fieldspec;
|
61 |
string m_fieldspec;
|
59 |
|
62 |
|
60 |
/* String value. Valid for op == OP_LEAF or EXCL */
|
63 |
/* String value. Valid for op == OP_LEAF or EXCL */
|
61 |
string m_value;
|
64 |
string m_value;
|
62 |
|
65 |
|