|
a/src/query/filtseq.h |
|
b/src/query/filtseq.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 _FILTSEQ_H_INCLUDED_
|
17 |
#ifndef _FILTSEQ_H_INCLUDED_
|
18 |
#define _FILTSEQ_H_INCLUDED_
|
18 |
#define _FILTSEQ_H_INCLUDED_
|
19 |
/* @(#$Id: filtseq.h,v 1.3 2008-09-29 08:59:20 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: filtseq.h,v 1.4 2008-09-29 11:33:55 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <vector>
|
21 |
#include <vector>
|
22 |
#include <string>
|
22 |
#include <string>
|
23 |
|
23 |
|
24 |
#include "refcntr.h"
|
24 |
#include "refcntr.h"
|
25 |
#include "docseq.h"
|
25 |
#include "docseq.h"
|
26 |
|
26 |
|
27 |
class DocSeqFiltSpec {
|
|
|
28 |
public:
|
|
|
29 |
DocSeqFiltSpec() {}
|
|
|
30 |
enum Crit {DSFS_MIMETYPE};
|
|
|
31 |
void orCrit(Crit crit, const string& value) {
|
|
|
32 |
crits.push_back(crit);
|
|
|
33 |
values.push_back(value);
|
|
|
34 |
}
|
|
|
35 |
std::vector<Crit> crits;
|
|
|
36 |
std::vector<string> values;
|
|
|
37 |
void reset() {crits.clear(); values.clear();}
|
|
|
38 |
bool isNotNull() {return crits.size() != 0;}
|
|
|
39 |
};
|
|
|
40 |
|
27 |
|
41 |
/**
|
28 |
/**
|
42 |
* A filtered sequence is created from another one by selecting entries
|
29 |
* A filtered sequence is created from another one by selecting entries
|
43 |
* according to the given criteria.
|
30 |
* according to the given criteria.
|
44 |
*/
|
31 |
*/
|
45 |
class DocSeqFiltered : public DocSequence {
|
32 |
class DocSeqFiltered : public DocSequence {
|
46 |
public:
|
33 |
public:
|
47 |
DocSeqFiltered(RefCntr<DocSequence> iseq, DocSeqFiltSpec &filtspec,
|
34 |
DocSeqFiltered(RefCntr<DocSequence> iseq, DocSeqFiltSpec &filtspec,
|
48 |
const std::string &t);
|
35 |
const std::string &t);
|
49 |
virtual ~DocSeqFiltered() {}
|
36 |
virtual ~DocSeqFiltered() {}
|
|
|
37 |
virtual bool canFilter() {return true;}
|
|
|
38 |
virtual bool setFiltSpec(DocSeqFiltSpec &filtspec);
|
50 |
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
|
39 |
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
|
51 |
virtual int getResCnt() {return m_seq->getResCnt();}
|
40 |
virtual int getResCnt() {return m_seq->getResCnt();}
|
52 |
virtual string getAbstract(Rcl::Doc& doc) {
|
41 |
virtual string getAbstract(Rcl::Doc& doc) {
|
53 |
return m_seq->getAbstract(doc);
|
42 |
return m_seq->getAbstract(doc);
|
54 |
}
|
43 |
}
|