Switch to unified view

a/src/query/docseqhist.h b/src/query/docseqhist.h
...
...
17
#ifndef _DOCSEQHIST_H_INCLUDED_
17
#ifndef _DOCSEQHIST_H_INCLUDED_
18
#define _DOCSEQHIST_H_INCLUDED_
18
#define _DOCSEQHIST_H_INCLUDED_
19
/* @(#$Id: docseqhist.h,v 1.3 2008-09-29 08:59:20 dockes Exp $  (C) 2004 J.F.Dockes */
19
/* @(#$Id: docseqhist.h,v 1.3 2008-09-29 08:59:20 dockes Exp $  (C) 2004 J.F.Dockes */
20
20
21
#include "docseq.h"
21
#include "docseq.h"
22
#include "history.h"
22
#include "dynconf.h"
23
23
24
namespace Rcl {
24
namespace Rcl {
25
    class Db;
25
    class Db;
26
}
26
}
27
28
/** DynConf Document history entry */
29
class RclDHistoryEntry : public DynConfEntry {
30
 public:
31
    RclDHistoryEntry() : unixtime(0) {}
32
    RclDHistoryEntry(long t, const string& u) 
33
  : unixtime(t), udi(u) {}
34
    virtual ~RclDHistoryEntry() {}
35
    virtual bool decode(const string &value);
36
    virtual bool encode(string& value);
37
    virtual bool equal(const DynConfEntry& other);
38
    long unixtime;
39
    string udi;
40
};
27
41
28
/** A DocSequence coming from the history file. 
42
/** A DocSequence coming from the history file. 
29
 *  History is kept as a list of urls. This queries the db to fetch
43
 *  History is kept as a list of urls. This queries the db to fetch
30
 *  metadata for an url key */
44
 *  metadata for an url key */
31
class DocSequenceHistory : public DocSequence {
45
class DocSequenceHistory : public DocSequence {
32
 public:
46
 public:
33
    DocSequenceHistory(Rcl::Db *d, RclHistory *h, const string &t) 
47
    DocSequenceHistory(Rcl::Db *d, RclDynConf *h, const string &t) 
34
    : DocSequence(t), m_db(d), m_hist(h), m_prevnum(-1), m_prevtime(-1) {}
48
    : DocSequence(t), m_db(d), m_hist(h), m_prevnum(-1), m_prevtime(-1) {}
35
    virtual ~DocSequenceHistory() {}
49
    virtual ~DocSequenceHistory() {}
36
50
37
    virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
51
    virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
38
    virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);
52
    virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);
39
    virtual int getResCnt();
53
    virtual int getResCnt();
40
    virtual string getDescription() {return m_description;}
54
    virtual string getDescription() {return m_description;}
41
    void setDescription(const string& desc) {m_description = desc;}
55
    void setDescription(const string& desc) {m_description = desc;}
42
 private:
56
 private:
43
    Rcl::Db    *m_db;
57
    Rcl::Db    *m_db;
44
    RclHistory *m_hist;
58
    RclDynConf *m_hist;
45
    int         m_prevnum;
59
    int         m_prevnum;
46
    long        m_prevtime;
60
    long        m_prevtime;
47
    string      m_description; // This is just an nls translated 'doc history'
61
    string      m_description; // This is just an nls translated 'doc history'
48
    list<RclDHistoryEntry> m_hlist;
62
    list<RclDHistoryEntry> m_hlist;
49
    list<RclDHistoryEntry>::const_iterator m_it;
63
    list<RclDHistoryEntry>::const_iterator m_it;
50
};
64
};
51
65
66
extern bool historyEnterDoc(RclDynConf *dncf, const string& udi);
67
52
#endif /* _DOCSEQ_H_INCLUDED_ */
68
#endif /* _DOCSEQ_H_INCLUDED_ */