Switch to unified view

a/src/query/docseqdb.h b/src/query/docseqdb.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 _DOCSEQDB_H_INCLUDED_
17
#ifndef _DOCSEQDB_H_INCLUDED_
18
#define _DOCSEQDB_H_INCLUDED_
18
#define _DOCSEQDB_H_INCLUDED_
19
/* @(#$Id: docseqdb.h,v 1.1 2007-01-19 10:32:39 dockes Exp $  (C) 2004 J.F.Dockes */
19
/* @(#$Id: docseqdb.h,v 1.2 2007-01-19 15:22:50 dockes Exp $  (C) 2004 J.F.Dockes */
20
#include <string>
20
#include "docseq.h"
21
#include <list>
21
#include "refcntr.h"
22
#ifndef NO_NAMESPACES
23
using std::string;
24
using std::list;
25
#endif
26
22
27
#include "docseq.h"
23
#include "searchdata.h"
28
namespace Rcl {
29
class Db;
30
}
31
24
32
/** A DocSequence from a Db query (there should be one active for this
25
/** A DocSequence from a Db query (there should be one active for this
33
    to make sense */
26
    to make sense) */
34
class DocSequenceDb : public DocSequence {
27
class DocSequenceDb : public DocSequence {
35
 public:
28
 public:
36
    DocSequenceDb(Rcl::Db *d, const string &t) : 
29
    DocSequenceDb(Rcl::Db *d, const string &t, RefCntr<Rcl::SearchData> sdata) 
37
    DocSequence(t), m_db(d), m_rescnt(-1) 
30
    : DocSequence(t), m_db(d), m_sdata(sdata), m_rescnt(-1) 
38
    {}
31
    {}
39
    virtual ~DocSequenceDb() {}
32
    virtual ~DocSequenceDb() {}
40
    virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string * = 0);
33
    virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string * = 0);
41
    virtual int getResCnt();
34
    virtual int getResCnt();
42
    virtual void getTerms(list<string>&);
35
    virtual bool getTerms(vector<string>& terms, 
36
            vector<vector<string> >& groups, 
37
            vector<int>& gslks) const {
38
  return m_sdata.getptr()->getTerms(terms, groups, gslks);
39
    }
40
43
    virtual string getAbstract(Rcl::Doc &doc);
41
    virtual string getAbstract(Rcl::Doc &doc);
42
    virtual string getDescription() {return m_sdata->getDescription();}
44
43
45
 private:
44
 private:
46
    Rcl::Db *m_db;
45
    Rcl::Db                 *m_db;
47
    int      m_rescnt;
46
    RefCntr<Rcl::SearchData> m_sdata;
47
    int                      m_rescnt;
48
};
48
};
49
49
50
#endif /* _DOCSEQDB_H_INCLUDED_ */
50
#endif /* _DOCSEQDB_H_INCLUDED_ */