|
a/src/query/docseq.h |
|
b/src/query/docseq.h |
1 |
#ifndef _DOCSEQ_H_INCLUDED_
|
1 |
#ifndef _DOCSEQ_H_INCLUDED_
|
2 |
#define _DOCSEQ_H_INCLUDED_
|
2 |
#define _DOCSEQ_H_INCLUDED_
|
3 |
/* @(#$Id: docseq.h,v 1.2 2005-11-28 15:31:01 dockes Exp $ (C) 2004 J.F.Dockes */
|
3 |
/* @(#$Id: docseq.h,v 1.3 2005-12-05 16:13:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
4 |
|
4 |
|
5 |
#include "rcldb.h"
|
5 |
#include "rcldb.h"
|
6 |
#include "history.h"
|
6 |
#include "history.h"
|
7 |
|
7 |
|
8 |
/** Interface for a list of documents coming from some source.
|
8 |
/** Interface for a list of documents coming from some source.
|
|
... |
|
... |
21 |
|
21 |
|
22 |
/** A DocSequence from a Db query (there should be one active for this
|
22 |
/** A DocSequence from a Db query (there should be one active for this
|
23 |
to make sense */
|
23 |
to make sense */
|
24 |
class DocSequenceDb : public DocSequence {
|
24 |
class DocSequenceDb : public DocSequence {
|
25 |
public:
|
25 |
public:
|
26 |
DocSequenceDb(Rcl::Db *d) : db(d) {}
|
26 |
DocSequenceDb(Rcl::Db *d) : m_db(d), m_rescnt(-1) {}
|
27 |
virtual ~DocSequenceDb() {}
|
27 |
virtual ~DocSequenceDb() {}
|
28 |
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string * = 0);
|
28 |
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string * = 0);
|
29 |
virtual int getResCnt();
|
29 |
virtual int getResCnt();
|
30 |
virtual std::string title() {return string("Query results");}
|
30 |
virtual std::string title() {return string("Query results");}
|
31 |
private:
|
31 |
private:
|
32 |
Rcl::Db *db;
|
32 |
Rcl::Db *m_db;
|
|
|
33 |
int m_rescnt;
|
33 |
};
|
34 |
};
|
34 |
|
35 |
|
35 |
/** A DocSequence coming from the history file */
|
36 |
/** A DocSequence coming from the history file */
|
36 |
class DocSequenceHistory : public DocSequence {
|
37 |
class DocSequenceHistory : public DocSequence {
|
37 |
public:
|
38 |
public:
|
38 |
DocSequenceHistory(Rcl::Db *d, RclDHistory *h)
|
39 |
DocSequenceHistory(Rcl::Db *d, RclDHistory *h)
|
39 |
: db(d), hist(h), prevnum(-1), prevtime(-1) {}
|
40 |
: m_db(d), m_hist(h), m_prevnum(-1), m_prevtime(-1) {}
|
40 |
virtual ~DocSequenceHistory() {}
|
41 |
virtual ~DocSequenceHistory() {}
|
41 |
|
42 |
|
42 |
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0);
|
43 |
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0);
|
43 |
virtual int getResCnt();
|
44 |
virtual int getResCnt();
|
44 |
virtual std::string title() {return string("Document history");}
|
45 |
virtual std::string title() {return string("Document history");}
|
45 |
private:
|
46 |
private:
|
46 |
Rcl::Db *db;
|
47 |
Rcl::Db *m_db;
|
47 |
RclDHistory *hist;
|
48 |
RclDHistory *m_hist;
|
48 |
int prevnum;
|
49 |
int m_prevnum;
|
49 |
long prevtime;
|
50 |
long m_prevtime;
|
50 |
|
51 |
|
51 |
std::list<RclDHistoryEntry> hlist;
|
52 |
std::list<RclDHistoryEntry> m_hlist;
|
52 |
std::list<RclDHistoryEntry>::const_iterator it;
|
53 |
std::list<RclDHistoryEntry>::const_iterator m_it;
|
53 |
};
|
54 |
};
|
54 |
|
55 |
|
55 |
#endif /* _DOCSEQ_H_INCLUDED_ */
|
56 |
#endif /* _DOCSEQ_H_INCLUDED_ */
|