|
a/src/query/docseqhist.h |
|
b/src/query/docseqhist.h |
|
... |
|
... |
29 |
|
29 |
|
30 |
/** DynConf Document history entry */
|
30 |
/** DynConf Document history entry */
|
31 |
class RclDHistoryEntry : public DynConfEntry {
|
31 |
class RclDHistoryEntry : public DynConfEntry {
|
32 |
public:
|
32 |
public:
|
33 |
RclDHistoryEntry() : unixtime(0) {}
|
33 |
RclDHistoryEntry() : unixtime(0) {}
|
34 |
RclDHistoryEntry(time_t t, const string& u)
|
34 |
RclDHistoryEntry(time_t t, const std::string& u, const std::string& d)
|
35 |
: unixtime(t), udi(u) {}
|
35 |
: unixtime(t), udi(u), dbdir(d) {}
|
36 |
virtual ~RclDHistoryEntry() {}
|
36 |
virtual ~RclDHistoryEntry() {}
|
37 |
virtual bool decode(const string &value);
|
37 |
virtual bool decode(const std::string &value);
|
38 |
virtual bool encode(string& value);
|
38 |
virtual bool encode(std::string& value);
|
39 |
virtual bool equal(const DynConfEntry& other);
|
39 |
virtual bool equal(const DynConfEntry& other);
|
40 |
time_t unixtime;
|
40 |
time_t unixtime;
|
41 |
string udi;
|
41 |
std::string udi;
|
|
|
42 |
std::string dbdir;
|
42 |
};
|
43 |
};
|
43 |
|
44 |
|
44 |
/** A DocSequence coming from the history file.
|
45 |
/** A DocSequence coming from the history file.
|
45 |
* History is kept as a list of urls. This queries the db to fetch
|
46 |
* History is kept as a list of urls. This queries the db to fetch
|
46 |
* metadata for an url key */
|
47 |
* metadata for an url key */
|
47 |
class DocSequenceHistory : public DocSequence {
|
48 |
class DocSequenceHistory : public DocSequence {
|
48 |
public:
|
49 |
public:
|
49 |
DocSequenceHistory(Rcl::Db *d, RclDynConf *h, const string &t)
|
50 |
DocSequenceHistory(Rcl::Db *d, RclDynConf *h, const std::string &t)
|
50 |
: DocSequence(t), m_db(d), m_hist(h) {}
|
51 |
: DocSequence(t), m_db(d), m_hist(h) {}
|
51 |
virtual ~DocSequenceHistory() {}
|
52 |
virtual ~DocSequenceHistory() {}
|
52 |
|
53 |
|
53 |
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
|
54 |
virtual bool getDoc(int num, Rcl::Doc &doc, std::string *sh = 0);
|
54 |
virtual int getResCnt();
|
55 |
virtual int getResCnt();
|
55 |
virtual string getDescription() {return m_description;}
|
56 |
virtual std::string getDescription() {return m_description;}
|
56 |
void setDescription(const string& desc) {m_description = desc;}
|
57 |
void setDescription(const std::string& desc) {m_description = desc;}
|
57 |
protected:
|
58 |
protected:
|
58 |
virtual Rcl::Db *getDb();
|
59 |
virtual Rcl::Db *getDb();
|
59 |
private:
|
60 |
private:
|
60 |
Rcl::Db *m_db;
|
61 |
Rcl::Db *m_db;
|
61 |
RclDynConf *m_hist;
|
62 |
RclDynConf *m_hist;
|
62 |
time_t m_prevtime{-1};
|
63 |
time_t m_prevtime{-1};
|
63 |
std::string m_description; // This is just an nls translated 'doc history'
|
64 |
std::string m_description; // This is just an nls translated 'doc history'
|
64 |
std::vector<RclDHistoryEntry> m_history;
|
65 |
std::vector<RclDHistoryEntry> m_history;
|
65 |
};
|
66 |
};
|
66 |
|
67 |
|
67 |
extern bool historyEnterDoc(RclDynConf *dncf, const string& udi);
|
68 |
extern bool historyEnterDoc(Rcl::Db *db, RclDynConf *dncf, const Rcl::Doc& doc);
|
68 |
|
69 |
|
69 |
#endif /* _DOCSEQ_H_INCLUDED_ */
|
70 |
#endif /* _DOCSEQ_H_INCLUDED_ */
|